//
//  PSCompanyCell.m
//  Btpin
//
//  Created by Vic on 2019/7/27.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "PSCompanyCell.h"

@interface PSCompanyCell ()
{
    UILabel *lbl;
}
@end

@implementation PSCompanyCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI {
    self.backgroundColor = COLOR_OF_CLEAR;
    self.contentView.backgroundColor = COLOR_OF_CLEAR;
    lbl = [UIToolsControl initLabelWithFrame:self.bounds text:nil textColor:THEMECOLOR_OF_TEXT_666666 font:Font_13];
    lbl.userInteractionEnabled = NO;
    lbl.textAlignment = NSTextAlignmentCenter;
    lbl.layer.cornerRadius = 5*Scale;
    lbl.layer.masksToBounds = YES;
    [self.contentView addSubview:lbl];
}
- (void)reloadData:(PublicCategoryElementModel *)model {
    lbl.frame = CGRectMake(0, 0, model.itemWidth, self.frame.size.height);
    
    if (model.isSelect) {
        lbl.backgroundColor = THEMECOLOR_OF_ORANGE;
        lbl.textColor = COLOR_OF_WHITE;
    } else {
        lbl.backgroundColor = THEMECOLOR_OF_GRAY;
        lbl.textColor = THEMECOLOR_OF_TEXT_666666;
    }
    lbl.text = model.name;
}

@end
